﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System.Windows.Media;

namespace phoneApp
{
    public partial class RegistrationPage : PhoneApplicationPage
    {
        public RegistrationPage()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            bool ok = true;

            if (regLoginBox.Text.Equals(""))
            {
                regLoginBox.Background = new SolidColorBrush(Colors.Red);
                ok = false;
            }

            if (regPassBox.Text.Equals(""))
            {
                regPassBox.Background = new SolidColorBrush(Colors.Red);
                ok = false;
            }

            if (regRepPassBox.Text.Equals("") || !regRepPassBox.Text.Equals(regPassBox.Text))
            {
                regRepPassBox.Background = new SolidColorBrush(Colors.Red);
                ok = false;
            }

            if (regNameBox.Text.Equals(""))
            {
                regNameBox.Background = new SolidColorBrush(Colors.Red);
                ok = false;
            }

            if (regLastnameBox.Text.Equals(""))
            {
                regLastnameBox.Background = new SolidColorBrush(Colors.Red);
                ok = false;
            }

            if (ok)
            {
                // reg
            }
        }
    }
}